package edu.sctu.wangfuxin.day20150520;

/**
 * Created by user06 on 2015/5/17.
 */
public class TextMore {

    /**
     *
     * sortnumber()是对老师学号进行排序
     * @param t1
     * @return
     */
    public  TeaCher[] sortNumber(TeaCher[] t1){
        TeaCher tea;
        for (int i = 0; i <t1.length ; i++) {

            for (int j = 0; j <t1.length-1 ; j++)
                if (t1[j + 1].number > t1[j].number) {
                    tea = t1[j];
                    t1[j] = t1[j + 1];
                    t1[j + 1] = tea;
                }
        }
        return t1;
    }






/**
 * sortStudent()是对老师所教学生进行排序
 */


        public StudentMassage[] sotrStudent(StudentMassage[] st1){
        StudentMassage st;
        for (int i = 0; i < st1.length; i++) {
            for (int j = 0; j < st1.length-1; j++) {
                if(st1[j].getCode() > st1[j+1].getCode()) {
                    st = st1[j];
                    st1[j] = st1[j + 1];
                    st1[j + 1] = st;
                }
            }

        }
//            for (int i = 0; i < st1.length; i++) {
//                System.out.println(st1[i].code);
//            }
        return st1;
    }

    /**
     * pritCoded()一个是对老师职称为教授的进行返回
     * @param t1
     * @return
     */


        public TeaCher pritCode(TeaCher[] t1){
            TeaCher returnTeacher = null;
        for (TeaCher t : t1) {
            if(t.zhicheng.equals("教授")){
                returnTeacher = t;
                System.out.println(returnTeacher.name+returnTeacher.zhicheng);
            }
        }

        return returnTeacher;
    }

//        创建一个类为TextOne,TextOne继承自TextMore，TextMore有三个方法，sotrNumber()一个是对老师学号
//        进行排序，sortStudent()一个是对老师所教学生成绩进行排序。pritCoded()一个是对老师职称为教授的进行返回
}



